package com.lagou.firststage.fourmode;

/**
 * @author：dingyuan
 * @date：Created in 2022/1/15 22:07
 * @description：作业一测试类
 * @version: 1.0
 */
public class WorkOneTest {
    public static void main(String[] args){
        try {
            Staff staff1 = new Staff("李四", 18);
            System.out.println("staff1：" + staff1);

            // 员工年龄小于18或者大于150，抛出年龄异常
            Staff staff2 = new Staff("张三", 15);
            System.out.println("staff2：" + staff1);

            // 员工姓名为空，抛出空指针异常
            Staff staff3 = new Staff(null, 18);
            System.out.println("staff3：" + staff1);
        } catch (AgeException e) {
            e.printStackTrace();
        }

    }
}
